package com.yict.csms.baseInfo.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.yict.common.service.impl.BaseServiceImpl;
import com.yict.csms.baseInfo.dao.IPersonOrderSetDao;
import com.yict.csms.baseInfo.entity.PersonOrderSet;
import com.yict.csms.baseInfo.service.IPersonOrderSetService;
import com.yict.csms.system.entity.DataDict;

@Service("personOrderSetService")
public class PersonOrderSetServiceImpl extends BaseServiceImpl<PersonOrderSet, Long, IPersonOrderSetDao> implements
		IPersonOrderSetService {

	/**
	 * 根据code查找一个人员订更集，没找到返回null
	 * 
	 * @param code
	 * @return
	 */
	public PersonOrderSet findByCode(String code) {
		PersonOrderSet vo = null;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("setcode", code);
		List<PersonOrderSet> list = this.list(map, null, null);
		if (list.size() > 0)
			vo = list.get(0);
		return vo;
	}

	@Override
	@Resource(name = "personOrderSetDao")
	public void setBaseDao(IPersonOrderSetDao baseDao) {
		super.setBaseDao(baseDao);
	}
}
